<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="/fuman/js/product.js"></script>
<script>
function showimages(id,t,s)
{
	$.post("/product/ajaxbutton", {"op": "showImages","id":id},
	  function(data){
			if(data)
			{
				var tmp="<div class=upload_preview>";
				for(var i=0;i<data.length;i++)
				{
					if(s==1)
					{
						var dels= "<div class=\"delnocss\" style='right:-15px;'><a href=\"#\" title=\"删除图片\"><img src=\"/fuman/images/no.gif\" onclick=\"delone("+data[i].id+",'productdevelop')\"></a></div>";	
					}else{
						var dels="";
					}
					tmp+=" <div style='border:1px;width:90px;  margin: 1em;float: left;position: relative;'><a href="+data[i].images_url+" target=_thank><img src='"+data[i].thumb_url+"' style=\"width:expression(this.width > 85 ? 85px : this.width)\"></a>"+dels+"</div>";
				}
				tmp+="</div>";
				$("#showimages").html(tmp);
			}
			
	   },"json");
	$("#MergeProductID").val(id);
	if(t==1)
	{
		$("#zyupload").hide();	
	}
	$('#showimagesform').modal('show');
		
}
function changstauts(id,status)
{
	if(confirm("你确认改变状态?"))
	{
	  $.post("/product/ajaxbutton", {"op": "channewproductgstauts","id":id,"status":status},
	  function(data){
				window.location.reload();
	   },"json");
	}	
}
function showthesample(id,status)
{
	$("#endorderlistst").html('');
	 $.post("/product/ajaxbutton", {"op": "getoneproductdata","id":id},
	  function(data){
				if(data)
				{
					$("#versiondivision").find("option[value="+data.versiondivision+"]").attr("selected",true);
					if(data.wages=='0.00')data.wages='';
					if(data.samplecosprice=='0.00')data.samplecosprice='';
					if(data.bulkprice=='0.00')data.bulkprice='';
					$("#wages").val(data.wages);
					$("#weight").val(data.weight);
					$("#cosprice").val(data.samplecosprice);
					$("#qualitymemo").val(data.qualitymemo);
					$("#bulkprice").val(data.bulkprice);
					$("#ck").val(data.ck);
					$("#samplememo").val(data.samplememo);
					var arr=new String();
					arr = data.bodystandard.split("+");
					for(var i=0;i<arr.length;i++)
					{
						$("#bodystandard"+arr[i]).attr("checked","checked");
					}
					if(data.sampleuser){
					$("#sampleuser").html("<tr><th>出样人：</th><td>"+data.sampleuser+"</td></tr>");
					}
					
					var material = data.material;
					 if (material.length > 0) {
						 var str ="";
                        for (var s = 0; s < material.length; s++) {
								var totalnum = s+1111;
							    str += "<tr id=las"+totalnum+">";
								str +="<td><span id=status"+totalnum+"></span><a href=javascript:void(0) onclick=delfiledsinput("+totalnum+")>移</a></td><td><input name=\"materialcode[]\" id=materialcode"+totalnum+" value='"+material[s].materialcode+"' placeholder=\"物料编号\" onBlur=\"getmaterialdata("+totalnum+")\"  class=\"width80\" type=\"text\"></td><td><input name=\"materialnum[]\" placeholder=\"数量\" value="+material[s].materialnum+" id=\"materialnum"+totalnum+"\" onBlur=\"getmaterialdata("+totalnum+")\" type=\"text\"  class=\"width100\">&nbsp;<input name=\"marterdw[]\" id=\"marterdw"+totalnum+"\" type=\"hidden\" ><span id=dw"+totalnum+"></span></td><td> <input name=\"materialtypename[]\" placeholder=\"物料名称\" id=\"materialtypename"+totalnum+"\" type=\"text\"  class=\"width100\" value="+material[s].materialtypename+"></td><td><input name=\"materialname[]\"  value='"+material[s].materialname+"' placeholder=\"物料名称\" id=\"materialname"+totalnum+"\" type=\"text\"  class=\"width100\"><td><input name=\"materwages[]\" placeholder=\"单价\"  value="+material[s].materwages+"  id=\"materwages"+totalnum+"\" type=\"text\"  class=\"width100\">&nbsp;<span id=materialprice"+totalnum+"></span></td>";
								str+="</tr>";
						}
						$("#endorderlistst").html(str);
                    }
					
					
				}
	   },"json");
	$("#MProductID").val(id);
	$("#MProductstatus").val(status);
	$('#showthesampleform').modal('show');	
}
function doFinish(id,linkUrl,flag) {
				if(flag == 1){
					$("#external_id").val(id);
					if(linkUrl){
						$("#linkUrl").val(linkUrl);
					}
					$("#dofinishform").show();
				}
				if(flag==2){
					var external_id = $("#external_id").val();
					var linkUrl  = $.trim($("#linkUrl").val());
					if(linkUrl){
					}else{
						alert("链接不能为空");return false;
					}
					$.post("/product/ajaxbutton", {"op": "doFinish","external_id":external_id,"linkUrl":linkUrl},
							function(data){
								if(data == 200)
								{
									alert("成功!");
									window.location.reload();
								}
							},"text");
				}
			}
function savechuyang()
{

	if($("#versiondivision").val()=='')
	{
		$("#versiondivisionerr").html('<font color=red>&nbsp;&nbsp;<B>必须选择打版师</B></font>');	
		$("#versiondivision").focus();
		return false;
	}else{
		$("#versiondivisionerr").html('');	
	}
	if($("#wages").val()=='0.00' || $("#wages").val()=='')
	{
		$("#wageserr").html('<font color=red>&nbsp;&nbsp;<B>请填写工价</B></font>');	
		$("#wageserr").focus();
		return false;	
	}else{
		$("#wageserr").html('');		
	}
	if($("#weight").val()==0 || $("#weight").val()==''){
		alert("重量必填");return false;
	}

	if($("#cosprice").val()=='0.00' || $("#cosprice").val()=='' )
	{
		$("#cospriceerr").html('<font color=red>&nbsp;&nbsp;<B>请填写成本价</B></font>');	
		$("#cospriceerr").focus();
		return false;	
	}else{
		$("#cospriceerr").html('');		
	}
	if($("#bulkprice").val()=='0.00' || $("#bulkprice").val()=='' )
	{
		$("#bulkpriceerr").html('<font color=red>&nbsp;&nbsp;<B>请填写批量价</B></font>');	
		$("#bulkprice").focus();
		return false;	
	}else{
		$("#bulkpriceerr").html('');		
	}
	var i=0;
	var str='';
	var vote_arr = document.getElementsByName("bodystandard[]");
	for(var j = 0; j < vote_arr.length; j++)
	{
	   if(vote_arr[j].checked == true)
	   {
		     str += vote_arr[j].value+"+";
		   i++;
	   } 
	}
	if(i<=0){
    	$("#bodystandarderr").html('<font color=red>&nbsp;&nbsp;<br><B>请选择主件质检信息</B></font>');	
     return false;
    }else{
		$("#bodystandarderr").html('');	
	}
	//判断物料编号 materialnum
	var materialnum_arr = document.getElementsByName("materialnum[]");
	if(materialnum_arr.length>0){
		for(var j = 0; j < materialnum_arr.length; j++)
		{
			if(materialnum_arr[j].value)
			{
			}else{
				alert("物料编号不能为空");return false;
			}
		}
	}

	if($("#qualitymemo").val()=='')
	{
		$("#qualitymemoerr").html('<font color=red>&nbsp;&nbsp;<B><br>质检信息必须填写</B></font>');	
		$("#qualitymemoerr").focus();
		return false;	
	}else{
		$("#qualitymemoerr").html('');		
	}
	if($("#ck").val()=='')
	{
		$("#ckerr").html('<font color=red>&nbsp;&nbsp;<B><br>面料信息必须填写</B></font>');	
		$("#ckerr").focus();
		return false;	
	}else{
		$("#ckerr").html('');		
	}
	var title = "主件质检信息: "+str+"\r\n其他质检信息:"+$("#qualitymemo").val()+"\r\n";
	if(confirm("请确认：\r\n"+title))
	{
	$('#showthesampleform').modal('hide');
	AWS.ajax_post($('#utimgtform'));	
	}
}


var totalnum = 1;
function showaddinput(t)
{
	$("#fileinput").html('');
	var inputn = document.getElementById(t);
	var str=inputn.innerHTML;
	var num=1;
	for(var i=1;i<=num;i++){
		totalnum=totalnum+i;
		
		str += "<tr id=las"+totalnum+">";
		str +="<td><span id=status"+totalnum+"></span><a href=javascript:void(0) onclick=delfiledsinput("+totalnum+")>移</a></td><td><input name=\"materialcode[]\" id=materialcode"+totalnum+" placeholder=\"物料编号\" onBlur=\"getmaterialdata("+totalnum+")\"  class=\"width80\" type=\"text\"></td><td><input name=\"materialnum[]\" placeholder=\"数量\" id=\"materialnum"+totalnum+"\" onBlur=\"getmaterialdata("+totalnum+")\"  type=\"text\"  class=\"width100\">&nbsp;<input name=\"marterdw[]\" id=\"marterdw"+totalnum+"\" type=\"hidden\" ><span id=dw"+totalnum+"></span></td><td><input name=\"materialtypename[]\" placeholder=\"物料名称\" id=\"materialtypename"+totalnum+"\" type=\"text\"  class=\"width100\"></td><td><input name=\"materialname[]\" placeholder=\"物料名称\" id=\"materialname"+totalnum+"\" type=\"text\"  class=\"width100\"><td><input name=\"materwages[]\" placeholder=\"单价\" id=\"materwages"+totalnum+"\" type=\"text\"  class=\"width100\">&nbsp;<span id=materialprice"+totalnum+"></span></td>";
		str+="</tr>";
		
	
	}
	$("#"+t).before(str);
	
}
function getmaterialdata(id)
{
	var materialcode = $("#materialcode"+id).val();//物料编号
	var materialnum  = $("#materialnum"+id).val();//物料数量
	if(materialcode)
	{
	 $.post("/product/ajaxbutton", {"op": "getmaterialcode","materialcode":materialcode,"materialnum":materialnum},
	  function(data){
			if(data == 201)
			{
				alert('没有找到该物料编号！');
				$("#materialcode"+id).val('');
				return false;
			}else{
				$("#materialtypename"+id).val(data.typename);
				$("#materialname"+id).val(data.projeck);
				$("#materwages"+id).val(data.price);
				$("#dw"+id).html(data.dw);
				$("#marterdw"+id).val(data.dw);
				if(data.materialprice)
				{
					$("#materialprice"+id).html(" 合计："+data.materialprice+" RMB");	
				}
			}
	   },"json");
	}
}
function delfiledsinput(id)
{
	if(confirm("确定移除？"))
	{
		$("#las"+id).remove();
	}
}
//推荐商品
function doRecommend(flag) {
	var str = selectallpro();
	if(str !=false)
	{
		if(flag==0){
			$("#extIds").val(str);
			$('#dorecommendform').show();
		}
		if(flag==1){
			var vote_arr = document.getElementsByName("receiver[]");
			var idarr = new Array();
			var i=0;
			var strs="";
			for(var j = 0; j < vote_arr.length; j++){
				if(vote_arr[j].checked == true){
					idarr[i] = vote_arr[j].value;
					strs += vote_arr[j].value+",";
					i++;
				}
			}
			if(i<=0){
				alert("未选中相关推荐者");
				return false;
			}
			$.post("/product/ajaxbutton", {"op": "doRecommendGoods","ids":str,"receiver":strs},
					function(data){
						if(data)
						{
							alert("推荐成功!");
							window.location.reload();
						}
					},"text");
		}

	}
}
function checkAll() {
	var arr_receiver = document.getElementsByName("receiver[]");
	for(var i = 0; i < arr_receiver.length; i++){
		if(arr_receiver[i].checked == true){
			arr_receiver[i].checked = false;
		}else{
			arr_receiver[i].checked = true;
		}
	}
}
function showreport(sku)
{
	$.post("/externalBuy/ajaxbutton", {"op": "showreport","sku":sku,"type":1},
		function(data){
			if(data == 201)
			{
				alert("暂无销售数据!");return false;	
			}else{
				$("#reportShowhtml").html(data);
				$('#returndataModal').modal('show');
			}
			
			alert(tmp);
		},"text");
}
</script>
<title>新品开发列表</title>
<body class="withvernav">
<div class="bodywrapper">
    {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent">
        <div class="pageheader notab">
            <h1 class="pagetitle">新品开发列表</h1>
            <span class="pagedesc"></span>
            <div class="menulist">
                <ul class="profile_summary">
                    {{if $managers || in_array('95',$showpower)}}
                    <li><a href="/product/addNewprodct"><span>添加开发新品</span></a></li>{{/if}}
                </ul>
            </div>
        </div>
        <!--pageheader-->

        <div id="contentwrapper" class="contentwrapper">
            <div id="basicform" class="subcontent">
	            <div style="float:left">

		            <button class="stdbtn btn_lime" onClick="doRecommend(0);return false;">推荐商品</button>&nbsp;&nbsp;&nbsp;

	             </div>
                <!--搜索栏-->
                <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>

                <form class="stdform stdform2" method="get" id="search" action="/product/newproduct">
                    <input type='hidden' name='if_csv' id='if_csv'>

                    <div class="tableoptions">


                        <select name="ty" id="searchtype" class="selection" style="width:100px;">
                            <option value="1" {{if $ty==1}} selected{{/if}}>创建时间</option>
                            <option value="2" {{if $ty==2}} selected{{/if}}>完成时间</option>
                        </select>

                        <input type="text" name="starttime" value="{{$starttime}} "
                               onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker"/> - <input
                                type="text" name="endtime" value="{{$endtime}} "
                                onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker"/>
                        关键词: <input type="text" name="other" id="other" class="width300" value="{{$other}}"
                                    placeholder="SKU(多个以逗号隔开)"/>
                        &nbsp;
                        状态:
                        <select class="selectCss2" name="status" id="status">
                            <option value="">请选择</option>
                            <option value="1" {{if $status==1}} selected{{/if}}>新开发</option>
                            <option value="2" {{if $status==2}} selected{{/if}}>已初审</option>
                            <option value="3" {{if $status==3}} selected{{/if}}>已出样</option>
                            <option value="4" {{if $status==4}} selected{{/if}}>已复审</option>
                            <option value="5" {{if $status==5}} selected{{/if}}>已出图</option>
                            <option value="6" {{if $status==6}} selected{{/if}}>已完成</option>
                            <option value="7" {{if $status==7}} selected{{/if}}>已否决</option>
                        </select>
                        操作人员: <input type="text" name="createName" id="createName" class="width200" value="{{$createName}}"
                                    placeholder="请输入操作人员"/>
                        &nbsp;
                        来源工厂:
                        <select class="selectCss2" name="factory_id" id="factory_id">
                            <option value="">请选择</option>
                            <option value="1" {{if $factory_id==1}} selected{{/if}}>工厂1</option>
                            <option value="2" {{if $factory_id==2}} selected{{/if}}>工厂2</option>
                            <option value="7" {{if $factory_id==7}} selected{{/if}}>其他</option>
                        </select>
                        &nbsp;
                        <button class="btn btn_orange btn_search radius50">Search</button>
                    </div>


                </form>
                <!--搜索栏结束-->
                <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                    <thead>
                    <tr class="lbbt">
                        <td width="5%" bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
                        <td width="8%" bgcolor="#FEFFF1">新品编号</td>
                        <td width="10%" bgcolor="#FEFFF1">图片</td>
                        <td width="20%" bgcolor="#FEFFF1">商品信息</td>
                        <td width="5%" bgcolor="#FEFFF1">预售价</td>
                       <!-- <td width="12%" bgcolor="#FEFFF1">操作信息</td>-->
                        <td width="5%" bgcolor="#FEFFF1">状态</td>
                        <td width="8%" bgcolor="#FEFFF1">操作人员</td>
                        <td width="5%" bgcolor="#FEFFF1">来源</td>
                        <td width="8%" bgcolor="#FEFFF1">创建/期望/推荐</td>
                        <td width="5%" bgcolor="#FEFFF1">样本链接</td>
	                    <td width="10%" bgcolor="#FEFFF1">受推荐人</td>
                        <td width="15%" bgcolor="#FEFFF1">操作</td>

                    </tr>
                    </thead>

                    {{foreach from=$goodslist item=li key=key}}
                    <tbody id="bdetail{{$detail.p_parent_id}}">
                    <tr>
                        <td><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}" onClick="showallchangsmod()"/></td>
                        <td valign="middle" style="position:relative;">
                         {{if $li.status==6}}<a href="/product/productlist?other={{$li.sku}}" target="_blank">{{$li.sku}}</a>{{else}}{{$li.sku}}{{/if}}
                        </td>
                        <td valign="middle">
                        {{if $li.mod==1}}
                        	<a href="javascript:void(0)" onClick="showimages({{$li.id}},0,1)"><img src="{{$li.images}}" width="50"></a>
                        {{else}}
                       		 <a href="javascript:void(0)" onClick="showimages({{$li.id}},0,0)"><img src="{{$li.images}}" width="50"></a>
                        {{/if}}
                        </td>
                        <td>
                            <div class="lbcp">
                                {{$li.name}}<br>
                                {{$li.en_name}}<br>
                                
                                 {{if $li.linkUrl}}
	                        <a href="{{$li.linkUrl}}" target="_blank"><font color="#FF0000">参考连接</font><img src="/fuman/images/icons/attachment.png"></a>
	                        {{/if}}
                            </div>
                        </td>

                        <td valign="middle">{{$li.saleprice}}</td>
                      <!--  <td valign="middle">创建：{{$li.instime}}
                        {{if $li.trialtime}}<br>初审：{{$li.trialtime}}{{/if}}
                        {{if $li.sampletime}}<br>出样：{{$li.sampletime}}{{/if}}
                         {{if $li.reviewagain}}<br>复审：{{$li.reviewagain}}{{/if}}
                         {{if $li.overtime}}<br>出图：{{$li.overtime}}{{/if}}
                          {{if $li.overtime}}<br>完成：{{$li.overtime}}{{/if}}
                          {{if $li.overtime}}<br>同步：{{$li.overtime}}{{/if}}
                            
                        </td>-->
                        <td class="cz">{{$li.statusst}}<br>
	                        
                        	</td>
                        <td class="cz">开发人：{{$li.createName}}</td>
                        <td class="cz">{{if $li.supplier==1}}工厂1{{/if}}{{if $li.supplier==2}}工厂2{{/if}}{{if $li.supplier==3}}外采购{{/if}}
                        
                        {{if $li.supplier==7}}广州{{/if}}</td>
                        <td class="cz">
                        {{$li.instime}}<br>
                        {{$li.tbopertime}}<br>
                        {{$li.linkUrl_addtime}}
                        </td>
                        <td class="cz">
                        
                          {{if $li.mod==1}}
                        	<a href="javascript:void(0)" onClick="showimages({{$li.id}},0,1)">样本图</a>
                        {{else}}
                       		 <a href="javascript:void(0)" onClick="showimages({{$li.id}},0,0)">样本图</a>
                        {{/if}}
                       </td>
	                    <td class="cz">
                        
		                    <!-- 屏蔽工厂 1，2-->
		                    {{if $userclassid == 12 || $userclassid == 13 || $userclassid == 16}}
		                    {{else}}
							
			                    {{foreach from=$li.receivers item=res key=key}}
			                    {{if $res.flag == 1}}
			                    <a href="{{$res.address}}" style="color:red;" target="_blank">{{$arr_receiver[$res.userid]}}&nbsp;</a>
			                    {{elseif $res.flag == 2}}
			                    <a href="javascript:void(0);">
				                    <s>{{$arr_receiver[$res.userid]}}</s>
				                    <span id="tip_info">取消原因：{{$res.address}}</span></a>
			                    {{else}}
			                    {{$arr_receiver[$res.userid]}}&nbsp;
			                    {{/if}}
			                    {{/foreach}}
		                    {{/if}}
                            
                           
	                    </td>
                        <td class="cz">
                         <div style="margin-bottom:5px;">
							{{if $li.trialmod==1}}
                        	<button class="stdbtn" onClick="changstauts({{$li.id}},{{$li.status}})">初审</button> &nbsp;&nbsp;<button class="stdbtn" onClick="changstauts({{$li.id}},6)">初审否决</button><br>
                            {{/if}}
                            {{if $li.thesample==1}}
                        	<button class="stdbtn" onClick="showthesample({{$li.id}},{{$li.status}})">出样</button><br>
                            {{/if}}
                            {{if $li.reviewagainmod==1}}
                        	<button class="stdbtn" onClick="showthesample({{$li.id}},{{$li.status}})">复审</button><br>
                            {{/if}}
                            {{if $li.artistimagesmod==1}}
                        	<button class="stdbtn" onClick="changstauts({{$li.id}},{{$li.status}})">出图完成</button><br>
                            {{/if}}

                             </div>
                            
                            
                            {{if $managers || $li.mod==1}}
                          
                           <a href="/product/addNewprodct?id={{$li.id}}"> <button class="stdbtn">编辑</button></a>
                           <a href="javascript:void(0)" onClick="delone({{$li.id}},'delproductdevelop')"> <button class="stdbtn">删除</button></a>
                           
                          
                            {{/if}}
                            {{if $li.status==6}}
                            	<button class="stdbtn" onClick="showthesample({{$li.id}},{{$li.status}})">修改物料</button>&nbsp;&nbsp;
                            {{/if}}
                           <a href="/product/addNewprodct?id={{$li.id}}&show=1" target="_blank"> <button class="stdbtn">查看</button></a>
	                        {{if $userclassid == 12 || $userclassid ==13  || $userclassid ==16}}
	                        {{else}}
                             {{if $li.status==6}}
	                        <a href="javascript:void(0)" onClick="doFinish({{$li.id}},'{{$li.linkUrl}}',1)"><button class="stdbtn">参考连接</button></a> {{/if}}
                            {{if $li.showreport==1}}
                            	<a href="javascript:void(0)" onClick="showreport('{{$li.sku}}')"><button class="stdbtn">销售数据</button></a>
                            {{/if}}
	                        {{/if}}
                          
                        </td>
                    </tr>

                    {{/foreach}}
                </table>
                <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
            </div>
        </div>

<!-- 模态框（Modal） 样本图片-->
<form action="/product/ajaxbutton?op=saveProductImages"  method="post" name="uctform" id="uctform" >
<input type="hidden" name="MergeProductID" id="MergeProductID">
  <div class="modal fade" id="showimagesform" tabindex="-1" role="dialog" aria-labelledby="sshowimagesform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sshowimagesform">样本图 </h4>
        </div>
        <div class="modal-body">
        
        	<div style="width:100%;height:400px; overflow-y:scroll; border:0px solid;">
             <div id="showimages"></div>  
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
		<link rel="stylesheet" href="/fuman/upfile/uploadify/zyupload/skins/zyupload-1.0.0.min.css" type="text/css">
		<script type="text/javascript" src="/fuman/upfile/uploadify/zyupload/zyupload.basic-1.0.0.min.js"></script>
         <div id="upok"></div>  
         <div id="zyupload" class="zyupload"></div>  
         <div id="uploadInfnew"></div>  
         
	    <script type="text/javascript">
			$(function(){
				// 初始化插件
				$("#zyupload").zyUpload({
					width            :   "650px",                 // 宽度
					height           :   "400px",                 // 宽度
					itemWidth        :   "100px",                 // 文件项的宽度
					itemHeight       :   "95px",                 // 文件项的高度
					url              :   "/fuman/upfile/uploadify/up.php",              // 上传文件的路径
					fileType         :   ["jpg","png","txt","js","exe"],// 上传文件的类型
					fileSize         :   51200000,                // 上传文件的大小
					multiple         :   true,                    // 是否可以多个文件上传
					dragDrop         :   false,                   // 是否可以拖动上传文件
					tailor           :   false,                   // 是否可以裁剪图片
					del              :   true,                    // 是否可以删除文件
					finishDel        :   false,  				  // 是否在上传文件完成后删除预览
					/* 外部获得的回调接口 */
					onSelect: function(selectFiles, allFiles){    // 选择文件的回调方法  selectFile:当前选中的文件  allFiles:还没上传的全部文件
						console.info("当前选择了以下文件：");
						console.info(selectFiles);
					},
					onDelete: function(file, files){              // 删除一个文件的回调方法 file:当前删除的文件  files:删除之后的文件
						console.info("当前删除了此文件：");
						console.info(file.name);
					},
					onSuccess: function(file, response){          // 文件上传成功的回调方法
						console.info("此文件上传成功：");
						console.info(file.name);
						console.info("此文件上传到服务器地址：");
						console.info(response);
						//$("#uploadInf").append("<p>上传成功，文件地址是：" + response + "</p>");
						$("#uploadInfnew").append( response );
						$("#upok").html("<p><h1>上传成功，点击提交,保存图片</h1></p>");
					},
					onFailure: function(file, response){          // 文件上传失败的回调方法
						$("#uploadInf").append("<p>此文件上传失败：" + file.name + "</p>");
					},
					onComplete: function(response){           	  // 上传完成的回调方法
						console.info("文件上传完成");
						console.info(response);
					}
				});
				
			});
			
		</script> 
                </td>
            </tr>
          
          </table>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctform','showimagesform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）样本图片 -->

<!-- 模态框（Modal） 文员出样-->
<form action="/product/ajaxbutton?op=saveProductsample"  method="post" name="utimgtform" id="utimgtform" >
<input type="hidden" name="MProductID" id="MProductID">
<input type="hidden" name="MProductstatus" id="MProductstatus">

  <div class="modal fade" id="showthesampleform" tabindex="-1" role="dialog" aria-labelledby="sshowthesampleform" aria-hidden="true">
    <div class="modal-dialog" style="width:80%;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sshowthesampleform">出样信息填写 </h4>
        </div>
        <div class="modal-body">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tbody>
          	<span id="sampleuser"></span>
          <tr>
            <th width="8%">打版师
              </th>
            <td align="left" width="40%" ><select class="selection" id="versiondivision" name="versiondivision">
                <option value="">--请选择--</option>
				{{foreach from=$versiondivision item=li key=key}}				    			
                <option value="{{$li.id}}">{{$li.name}}</option>
             	{{/foreach}}
              </select><span id="versiondivisionerr"></span></td>
            <td align="left" width="8%">批量价</td>
            <td align="left" ><input type="text" name="bulkprice" id="bulkprice"  class="width100" onKeyUp="this.value=this.value.replace(/[^\d.]/g,'');"><span id="bulkpriceerr"></span></td>
          </tr>
          <tr>
            <th>工价
              </th>
            <td height="25"><input type="text" name="wages" id="wages"  onKeyUp="this.value=this.value.replace(/[^\d.]/g,'');" class="width100"><span id="wageserr"></span>
              </td>
            <td>成本价 </td>
            <td><input type="text" name="cosprice" id="cosprice"  class="width100" onKeyUp="this.value=this.value.replace(/[^\d.]/g,'');"><span id="cospriceerr"></span></td>
          </tr>
         
        
           <tr>
            <th>主件质检信息
              </th>
            <td colspan="3" align="left">
              {{foreach from=$bodystandard item=res key=key}}
              &nbsp;&nbsp;<input name="bodystandard[]" id="bodystandard{{$res}}" type="checkbox" value="{{$res}}">&nbsp;{{$res}}
              {{/foreach}}
              <span id="bodystandarderr"></span></td>
            </tr>
          <tr>
            <th>配件质检信息
              </th>
            <td align="left"><textarea name="qualitymemo" id="qualitymemo" cols="2" rows="2"></textarea><span id="qualitymemoerr"></span></td>
            <td align="left">面料信息</td>
            <td align="left"><textarea name="ck" id="ck" cols="2" rows="2"></textarea><span id="ckerr"></span></td>
          </tr>
          
          <tr>
            <th>备注信息
            </th><td align="left"><textarea name="memo" id="samplememo" cols="2" rows="2"></textarea></td>
            <td align="left">重量</td>
            <td align="left"><input type="text" name="weight" id="weight">克</td>
          </tr>
          
           <tr>
            <th colspan="4"> 
          新开款物料信息 <a href="javascript:void(0)"  onClick="showaddinput('fileinput')" class="btn btn_book"><span>添加一行</span></a>
          <br>
          <hr>
          <br></th>
            </tr>
            
         
        </tbody></table>
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
          
          <div style="width:100%;height:300px; overflow-y:scroll; border:0px solid;">
           <span id="endorderlistst">
           </span>
           <span id="fileinput"></span>
          </div>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="savechuyang()"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）出样框 -->

	    <!-- 推荐商品弹出框-->
	    <!-- 模态框（Modal）交运内容 -->
	    <form action="/externalBuy/doRecommendGoods" enctype="multipart/form-data" method="post" name="dorecommendattributeform" id="dorecommendattributeform" target="_blank" style="font-size: 14px;font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;line-height: 21px;color: #666;">
		    <div class="modal" id="dorecommendform" tabindex="-1" role="dialog" aria-labelledby="sexpressform" aria-hidden="true" style="margin-top: 60px;padding-top:60px;">
			    <div class="modal-dialog">
				    <div class="modal-content">
					    <div class="modal-header">
						    <button type="button" class="close" data-dismiss="modal"
						            aria-hidden="true" onClick="javascript:$('#dorecommendform').hide();">× </button>
						    <h4 class="modal-title"><span id="order_mailno" style="font-size:18px;">推荐商品信息接收者</span></h4>
					    </div>
					    <div class="modal-body">
						    <table width="100%" border="0" cellspacing="0" cellpadding="0">
							    <tr><td><input type="checkbox" onClick="checkAll();" />全选</td></tr>
							    <tr>
								    <td align="left" width="100">
									    {{foreach from=$receiverlist item=li key=key}}
									    <input type="checkbox" value="{{$li.id}}" name="receiver[]" />{{$li.name}}&nbsp;&nbsp;
									    {{/foreach}}
								    </td>
							    </tr>
                                <tr>
              <td style="">推荐说明：{{$receiverlistinstructions}}</td>
            </tr>
							    <tr><td style="color:red;font-size:18px;">备注：只能推荐已完成商品</td></tr>
						    </table>
						    <div class="modal-footer">
							    <button type="button" class="btn btn-default"
							            data-dismiss="modal" style="display:" onClick="javascript:$('#dorecommendform').hide();"> 关闭 </button>
							    <input type="hidden" name="extIds" id="extIds" value="">
							    <button type="button" class="btn btn-primary"  onclick="doRecommend(1)">确认推荐</button>
						    </div>
					    </div>
					    <!-- /.modal-content -->
				    </div>
				    <!-- /.modal-dialog -->
			    </div>
		    </div>
	    </form>
	    <!-- /.modal -->
	    <!-- 添加链接弹出框-->
	    <!-- 模态框（Modal）交运内容 -->
	    <form action="/product/ajaxbutton" enctype="multipart/form-data" method="post" name="dorecommendattributeform" id="dorecommendattributeform" target="_blank" style="font-size: 14px;font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;line-height: 21px;color: #666;">
		    <div class="modal" id="dofinishform" tabindex="-1" role="dialog" aria-labelledby="sexpressform" aria-hidden="true" style="margin-top: 60px;padding-top:60px;">
			    <div class="modal-dialog">
				    <div class="modal-content">
					    <div class="modal-header">
						    <button type="button" class="close" data-dismiss="modal"
						            aria-hidden="true" onClick="javascript:$('#dofinishform').hide();">× </button>
						    <h4 class="modal-title"><span id="addsure" style="font-size:18px;">添加链接</span></h4>
					    </div>
					    <div class="modal-body">
						    <table width="100%" border="0" cellspacing="0" cellpadding="0">
							    <tr>
								    <td align="left">链接地址：</td>
								    <td  align="left">
										<span>
										<input type='text'  name='linkUrl' id='linkUrl' placeholder='请输入相关链接,如：http://www.baidu.com'/>
										</span>
								    </td>
							    </tr>
						    </table>
						    <div class="modal-footer">
							    <button type="button" class="btn btn-default"
							            data-dismiss="modal" style="display:none"> 关闭 </button>
							    <input type="hidden" name="external_id" id="external_id" value="">
							    <button type="button" class="btn btn-primary"  onclick="doFinish(0,0,2)">保存</button>
						    </div>
					    </div>
					    <!-- /.modal-content -->
				    </div>
				    <!-- /.modal-dialog -->
			    </div>
		    </div>
	    </form>
	    <!-- /.modal -->
<!-- 弹出销售报表--> 
<!-- 模态框（Modal） -->
 <form action="#"  method="post" name="qaform" id="qaform"  enctype="multipart/form-data" >
 <input type="hidden" name="demandid_list" id="demandid_list" >
  <div class="modal fade" id="returndataModal" tabindex="-1" role="dialog" aria-labelledby="returnModalLabel" aria-hidden="true" style="margin-top: 60px;padding-top:60px;">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">×
            </button>
            <h4 class="modal-title" id="returnModalLabel">
               销售报表
            </h4>
            <br> 亚马逊分组：美一组：王彦喆;美二组: 吕婷婷;德国：许丰良;日本：梅俊杰;其他：美国<br>
         </div>
         <div class="modal-body">
         
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr >
            <td align="left">
            	<span id="reportShowhtml"></span>
              </td>
          </tr>
        
        </table>
        
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">
               关闭
            </button>
           
         </div>
         </div>
      </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</form>

</body>
</html>